
package ihm.actions.character_creator;

import ihm.views.character_creator.CharacterCreator;

import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
/**
 * 
 * @author Baptiste Legrand & Benjamin Orman
 */
public class LevelSelectedAction
    implements ItemListener {

  private CharacterCreator charCreatorFrame;
  
  public LevelSelectedAction(CharacterCreator source)
  {
    this.charCreatorFrame = source;
  }

  /* (non-Javadoc)
   * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
   */
  @Override
  public void itemStateChanged(ItemEvent e) {
    if(e.getItem() != null)
    {
      //System.out.println("Level selected");
      //Set enable the Line containing the Faction
      this.charCreatorFrame.getSelectFactionLabel().setEnabled(true);
      this.charCreatorFrame.getFactionComboBox().setEnabled(true);
      this.charCreatorFrame.getFactionIconLabel().setEnabled(true);
      //Update the classe list
      this.charCreatorFrame.updateClasses();
    }
  }

}
